<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends MX_Controller {

	/**
	 * Index Page for this controller.
	 */
	function __construct()
	{
		parent::__construct();
		$this->template->set_layout('default');
		
		//$this->template->set_partial('navbar_index', 'header/navbar_index');
		$this->template->set_partial('header_search', 'header/header_search');
		$this->template->set_partial('nav_bar', 'header/nav_bar');
		
		//$this->template->set_partial('modal_window', 'footer/modal_window');
		
		$this->load->model('category/category_model');
		$this->load->model('welcome_model');
		$this->load->model('location/location_model');
		$this->load->model('member/sale_model');
		//$this->load->model('listing/listing_model');
		
		//$this->session->sess_destroy();
	}
	
	public function index()
	{	
		$data['Page'] = "INDEX";
		
		//-- GET CATEGORY --//
		$data['category'] = $this->category_model->getCetegory(0,21);
		
		//--GET STATE --//
		$data['state'] = $this->location_model->getAllState($this->config->item('default_country'),0,$limit=21);
		
		//--GET CITY --//
		$data['city'] = $this->location_model->getAllCity($this->config->item('default_country'),0,$limit=21,' RAND()');
		
		$data['site_title'] = $this->settings_model->siteInfo('web_title');
		
		$data['tips'] = $this->settings_model->getTips($limit=5);
		
		$data['sale'] = $this->sale_model->getSales();
		
		
		
		/* META */
		$data['canonical'] = base_url();
		$this->template->title($data['site_title']);
		$this->template->set_metadata('keywords', $this->settings_model->siteInfo('keyword'));
		$this->template->set_metadata('description', $this->settings_model->siteInfo('description'));
		
		
		
		
		$this->template->build('index',$data);
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */
